package com.zrrd.gmall.mq.controller;

import com.zrrd.gmall.common.result.Result;
import com.zrrd.gmall.rabbit.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mq")
public class MqController {

    @Autowired
    private RabbitService rabbitService;

    //消息发送测试
    @GetMapping("/sendConfirm")
    public Result sendConfirm(){
        rabbitService.sendMessage("exchange.confirm","routing.confirm","这是一个测试消息");
        return Result.ok();
    }
}
